package com.may.wind.entity;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;

/**
 * 书籍信息
 */
@Entity
@Table(name = "books")
@JsonIgnoreProperties({"handler", "hibernateLazyInitializer"})
@ApiModel(description = "书籍")
public class Book implements Serializable {
    //private static final long serialVersionUID = 1L;

    @Id
    @SequenceGenerator(sequenceName = "book_sequence", name = "sequence_books", allocationSize = 1)
    @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "sequence_books")
    @Column(name = "id")
    @ApiModelProperty(name = "id", value = "ID", required = true)
    long id;

    @ManyToOne
    @JoinColumn(name = "category_id")
    @ApiModelProperty(name = "category", value = "书籍分类", required = true)
    private Category category;

    @ApiModelProperty(name = "cover", value = "封面")
    String cover;
    @ApiModelProperty(name = "title", value = "书名")
    String title;
    @ApiModelProperty(name = "author", value = "作者")
    String author;
    @ApiModelProperty(name = "date", value = "出版日期")
    Date date;
    @ApiModelProperty(name = "press", value = "出版社")
    String press;
    @ApiModelProperty(name = "abs", value = "简介")
    String abs;

    public Category getCategory() {
        return category;
    }

    public void setCategory(Category category) {
        this.category = category;
    }

    public String getCover() {
        return cover;
    }

    public void setCover(String cover) {
        this.cover = cover;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getAuthor() {
        return author;
    }

    public void setAuthor(String author) {
        this.author = author;
    }

    public Date getDate() {
        return date;
    }

    public void setDate(Date date) {
        this.date = date;
    }

    public String getPress() {
        return press;
    }

    public void setPress(String press) {
        this.press = press;
    }

    public String getAbs() {
        return abs;
    }

    public void setAbs(String abs) {
        this.abs = abs;
    }

    public long getId() {
        return id;
    }

    public void setId(long id) {
        this.id = id;
    }
}
